﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HumanResorcesProj.DAL._HR_DSTableAdapters;
using HumanResorcesProj.DAL;
namespace HumanResorcesProj.GUI
{
    public partial class MainWindow : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            GetDbSize();
        }
        private DataTable1TableAdapter info = null;
        public DataTable1TableAdapter adapter
        {
            get
            {
                if (info == null) info = new DataTable1TableAdapter();
                return info;
            }
        }

        public void GetDbSize()
    {
        DAL._HR_DS.DataTable1DataTable table = adapter.GetDBSize();
      
            double size = Convert.ToDouble(table[0][0]);
        
            double SizeInMega =(size / 1048576); //in megaByte
            double TotalSize = SizeInMega / 102.4;
            string Ssize= String.Format("{0:0.00}", TotalSize);
            Ssize = "מאגר הנתונים הכללי מלא ב " + Ssize + "%";
            Label3.Text = Ssize;
            
    }
    }
}
